package clone;

import org.apache.commons.lang.SerializationUtils;

public class SpecialDeepClone {
    public static void main(String[] args) {
        Professor p = new Professor("wangwu", 30);
        Student s1 = new Student("zhangsan", 18, p);
        // Student s2=s1;
        Student s2 = (Student) SerializationUtils.clone(s1);
        s2.name = "lisi";
        s2.age = 20;
        s2.p.age = 50;
        s2.p.name = "luliu";
        System.out.println(s1);
        System.out.println(s2);
    }
}
